package com.x.provider.oss.controller.rpc;

import com.x.core.web.api.R;
import com.x.provider.api.oss.model.dto.face.IdCardVerificationReqDTO;
import com.x.provider.api.oss.service.FaceIdRpcService;
import com.x.provider.oss.service.FaceIdService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/rpc/face/id")
public class FaceIdRpcController implements FaceIdRpcService {

    private final FaceIdService faceIdService;

    public FaceIdRpcController(FaceIdService faceIdService){
        this.faceIdService = faceIdService;
    }

    @PostMapping("/card/verification")
    @Override
    public R<Void> idCardVerification(IdCardVerificationReqDTO reqDTO) {
        faceIdService.idCardVerification(reqDTO.getIdCard(), reqDTO.getName());
        return R.ok();
    }
}
